//
//  ZYZHomeController.swift
//  MyWeiBo
//
//  Created by 牛牛很牛 on 15/12/15.
//  Copyright © 2015年 曾勇召. All rights reserved.
//

import UIKit

class ZYZHomeController: ZYZBaseController {

    override func viewDidLoad() {
        super.viewDidLoad()
        if ZYZUserAcount.userLogin == false {
            return
        }
        
        //系统自带的，不符合就重写  ，   frame = (0 0; 375 60)
      refreshControl = ZYZRefreshControl()
        
        
     //设置导航栏
        self.setupNav()
        
        //测试数据
        ZYZNetworkTool.shareNetworkTool1.loadStatus { (result, error) -> () in
            print("result: \(result)")
        }
        
    }


    
    func setupNav(){
      navigationItem.leftBarButtonItem = UIBarButtonItem(imageName: "navigationbar_friendsearch")
      navigationItem.rightBarButtonItem = UIBarButtonItem(imageName: "navigationbar_pop")
      let title = ZYZUserAcount.loadUserAccount()?.screen_name
        let titleButton = ZYZTitleView(imameName: "navigationbar_arrow_down", title: title!)
        titleButton.addTarget(self, action: "titleButtonClick:", forControlEvents: UIControlEvents.TouchUpInside)
        navigationItem.titleView = titleButton
    }
    
    func titleButtonClick(button: ZYZTitleView) {
        button.selected = !button.selected
        UIView.animateWithDuration(0.5) { () -> Void in
            button.imageView?.transform = button.selected ? CGAffineTransformMakeRotation(CGFloat(M_PI-0.001)) : CGAffineTransformIdentity
        }
        
    }
    
    
    
    
    
    
    
    override func numberOfSectionsInTableView(tableView: UITableView) -> Int {
        return 0
    }

    override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {

        return 0
    }



}
